import Conditions from '../../../../../resources/conditions';
import { Responses } from '../../../../../resources/responses';
import ZoneId from '../../../../../resources/zone_id';
import { RaidbossData } from '../../../../../types/data';
import { TriggerSet } from '../../../../../types/trigger';

// TODO: is there any way to figure out Svarbhanu color? It doesn't seem to be a headmarker.

export type Data = RaidbossData;

const triggerSet: TriggerSet<Data> = {
  id: 'Vanaspati',
  zoneId: ZoneId.Vanaspati,
  timelineFile: 'vanaspati.txt',
  triggers: [
    {
      id: 'Vanaspati Terminus Snatcher Note of Despair',
      type: 'StartsUsing',
      netRegex: { id: '6238', source: 'Terminus Snatcher', capture: false },
      response: Responses.aoe(),
    },
    {
      id: 'Vanaspati Terminus Snatcher Mouth Off',
      type: 'StartsUsing',
      netRegex: { id: '6231', source: 'Terminus Snatcher', capture: false },
      infoText: (_data, _matches, output) => output.text!(),
      outputStrings: {
        text: {
          en: 'Go To Silent Mouth',
          de: 'Geh zum geschlossenen Mund',
          fr: 'Allez sur une bouche silencieuse',
          ja: '閉じた口へ',
          cn: '找闭着的嘴',
          ko: '말이 없는 입 쪽으로',
        },
      },
    },
    {
      id: 'Vanaspati Terminus Snatcher Last Gasp',
      type: 'StartsUsing',
      netRegex: { id: '6235', source: 'Terminus Snatcher' },
      response: Responses.tankBuster(),
    },
    {
      id: 'Vanaspati Terminus Snatcher What Is Right',
      type: 'StartsUsing',
      netRegex: { id: '6233', source: 'Terminus Snatcher', capture: false },
      response: Responses.goLeft(),
    },
    {
      id: 'Vanaspati Terminus Snatcher What Is Left',
      type: 'StartsUsing',
      netRegex: { id: '6234', source: 'Terminus Snatcher', capture: false },
      response: Responses.goRight(),
    },
    {
      id: 'Vanaspati Terminus Snatcher Wallow',
      type: 'StartsUsing',
      netRegex: { id: '6236', source: 'Terminus Snatcher' },
      condition: Conditions.targetIsYou(),
      response: Responses.spread(),
    },
    {
      id: 'Vanaspati Terminus Wrecker Meaningless Destruction',
      type: 'StartsUsing',
      netRegex: { id: '6241', source: 'Terminus Wrecker', capture: false },
      response: Responses.aoe(),
    },
    {
      id: 'Vanaspati Terminus Wrecker Total Wreck',
      type: 'StartsUsing',
      netRegex: { id: '6242', source: 'Terminus Wrecker' },
      response: Responses.tankBuster(),
    },
    {
      id: 'Vanaspati Terminus Wrecker Aether Spray Knockback',
      type: 'StartsUsing',
      netRegex: { id: '623C', source: 'Terminus Wrecker' },
      delaySeconds: (_data, matches) => parseFloat(matches.castTime) - 5,
      response: Responses.knockback(),
    },
    {
      id: 'Vanaspati Terminus Wrecker Aether Spray Bubble',
      type: 'StartsUsing',
      netRegex: { id: '623B', source: 'Terminus Wrecker', capture: false },
      infoText: (_data, _matches, output) => output.text!(),
      outputStrings: {
        text: {
          en: 'Get In Bubble',
          de: 'Geh in die Blase',
          fr: 'Allez dans une bulle',
          ja: '泡に入る',
          cn: '进泡泡',
          ko: '구슬 안에 들어가기',
        },
      },
    },
    {
      id: 'Vanaspati Terminus Twitcher Double Hex Eye',
      type: 'StartsUsing',
      netRegex: { id: '6C21', source: 'Terminus Twitcher', capture: false },
      response: Responses.lookAway(),
    },
    {
      id: 'Vanaspati Svarbanu Flames of Decay',
      type: 'StartsUsing',
      netRegex: { id: '6252', source: 'Svarbhanu', capture: false },
      response: Responses.aoe(),
    },
    {
      id: 'Vanaspati Svarbhanu Cosmic Kiss Spread',
      type: 'StartsUsing',
      netRegex: { id: '6250', source: 'Svarbhanu' },
      condition: Conditions.targetIsYou(),
      response: Responses.spread(),
    },
    {
      id: 'Vanaspati Svarbhanu Gnashing Of Teeth',
      type: 'StartsUsing',
      netRegex: { id: '6253', source: 'Svarbhanu' },
      response: Responses.tankBuster(),
    },
    {
      id: 'Vanaspati Svarbhanu Aetherial Disruption',
      type: 'StartsUsing',
      netRegex: { id: '6248', source: 'Svarbhanu', capture: false },
      infoText: (_data, _matches, output) => output.text!(),
      outputStrings: {
        text: {
          en: 'Go To Opposite Color',
          de: 'Geh zur andere Farbe',
          fr: 'Allez sur la couleur opposée',
          ja: '反対の色へ',
          cn: '去异色地板',
          ko: '화면과 색이 다른 바닥으로',
        },
      },
    },
  ],
  timelineReplace: [
    {
      'locale': 'en',
      'replaceText': {
        'What Is Left/What Is Right': 'What Is Left/Right',
      },
    },
    {
      'locale': 'de',
      'replaceSync': {
        'Devatagara': 'Devatagara',
        'Insight': 'Vor dem Haus des Weisen',
        'Svarbhanu': 'Svarbhanu',
        'Terminus Snatcher': 'Terminus-Häscher',
        'Terminus Twitcher': 'Terminus-Zerrer',
        'Terminus Wrecker': 'Terminus-Verwüster',
        'Trnakiya': 'Bucht im Meer der Bäume',
      },
      'replaceText': {
        '\\(Knockback\\)': '(Rückstoß)',
        '\\(Spread\\)': '(Verteilen)',
        '--meteor': '--Meteor',
        'Aether Siphon': 'Elementarer Sog',
        'Aether Spray': 'Elementarer Auswurf',
        'Aetherial Disruption': 'Erdwallung',
        'Chaotic Pulse': 'Erdlabung',
        'Chaotic Undercurrent': 'Venenströme',
        'Cosmic Kiss': 'Einschlag',
        'Crumbling Sky': 'Meteorruf',
        'Flames of Decay': 'Lohen des Leids',
        'Gnashing of Teeth': 'Verbeißen',
        'Last Gasp': 'Verzweifeltes Flehen',
        'Lost Hope': 'Klage der Ohnmächtigen',
        'Meaningless Destruction': 'Rasender Kummer',
        'Mouth Off': 'Reden ist Silber',
        'Note of Despair': 'Klage der Hoffnungslosen',
        'Poison Heart': 'Toxischer Ausfluss',
        'Total Wreck': 'Blinde Zerstörung',
        'Unholy Water': 'Wasserfolter',
        'Vitriol': 'Schweigen ist Gold',
        'Wallow': 'Schluchzen',
        'What Is Left': 'Schändliche Linke',
        'What Is Right': 'Schändliche Rechte',
      },
    },
    {
      'locale': 'fr',
      'replaceSync': {
        'Devatagara': 'Temple de Devata',
        'Insight': 'Résidence du doyen',
        'Svarbhanu': 'Svarbhanu',
        'Terminus Snatcher': 'pillard de l\'apocalypse',
        'Terminus Twitcher': 'Picoreur De L\'Apocalypse',
        'Terminus Wrecker': 'destructeur de l\'apocalypse',
        'Trnakiya': 'Clairière de Vanaspati',
      },
      'replaceText': {
        '\\(Bubble\\)': '(Bulle)',
        '\\(Knockback\\)': '(Poussée)',
        '\\(Spread\\)': '(Dispersion)',
        '--meteor': '--météore',
        'Aether Siphon': 'Absorption élémentaire',
        'Aether Spray': 'Déjection élémentaire',
        'Aetherial Disruption': 'Désolation terrestre',
        'Chaotic Pulse': 'Revivification terrestre',
        'Chaotic Undercurrent': 'Turbulence terrestre',
        'Cosmic Kiss': 'Impact',
        'Crumbling Sky': 'Appel des météores',
        'Flames of Decay': 'Désespoir brûlant',
        'Gnashing of Teeth': 'Grignotement',
        'Last Gasp': 'Supplication',
        'Lost Hope': 'Cri hébété',
        'Meaningless Destruction': 'Chagrin enragé',
        'Mouth Off': 'Parole d\'argent',
        'Note of Despair': 'Cri de désespoir',
        'Poison Heart': 'Décharge toxique',
        'Total Wreck': 'Destruction aveugle',
        'Unholy Water': 'Torture aqueuse',
        'Vitriol': 'Silence d\'or',
        'Wallow': 'Sanglot',
        'What Is Left/What Is Right': 'Main gauche/droite purulente',
      },
    },
    {
      'locale': 'ja',
      'replaceSync': {
        'Devatagara': 'デーヴァター寺院',
        'Insight': '里長邸前',
        'Svarbhanu': 'スヴァーバーヌ',
        'Terminus Snatcher': 'ターミナス・スナッチャー',
        'Terminus Twitcher': 'ターミナス・ツイッチャー',
        'Terminus Wrecker': 'ターミナス・レッカー',
        'Trnakiya': '樹海の空地',
      },
      'replaceText': {
        '\\(Knockback\\)': '(ノックバック)',
        '\\(Spread\\)': '(散開)',
        '--meteor (\\d)--': '--メテオ #$1--',
        'Aether Siphon': '属性吸収',
        'Aether Spray': '属性放出',
        'Aetherial Disruption': '地脈暴走',
        'Chaotic Pulse': '地脈活性',
        'Chaotic Undercurrent': '地脈乱流',
        'Cosmic Kiss': '着弾',
        'Crumbling Sky': '流星招来',
        'Flames of Decay': '絶望の炎',
        'Gnashing of Teeth': '噛みつき',
        'Last Gasp': '哀訴',
        'Lost Hope': '自失の叫び',
        'Meaningless Destruction': '絶望の狂乱',
        'Mouth Off': '有口無行',
        'Note of Despair': '絶望の叫び',
        'Poison Heart': '毒液塊',
        'Total Wreck': '打ち壊し',
        'Unholy Water': '水牢弾',
        'Vitriol': '有言実行',
        'Wallow': '嗚咽',
        'What Is Left/What Is Right': '穢れた左手/右手',
      },
    },
    {
      'locale': 'cn',
      'replaceSync': {
        'Devatagara': '天神寺',
        'Insight': '村长屋前',
        'Svarbhanu': '斯伐婆奴',
        'Terminus Snatcher': '终末的抢夺',
        'Terminus Twitcher': '终末的抽搐',
        'Terminus Wrecker': '终末的破坏',
        'Trnakiya': '森中空地',
      },
      'replaceText': {
        '\\(Knockback\\)': '(击退)',
        '\\(Spread\\)': '(扩散)',
        '--meteor': '--陨石',
        'Aether Siphon': '属性吸收',
        'Aether Spray': '属性放出',
        'Aetherial Disruption': '地脉失控',
        'Chaotic Pulse': '地脉活性',
        'Chaotic Undercurrent': '地脉乱流',
        'Cosmic Kiss': '流星坠落',
        'Crumbling Sky': '召唤流星',
        'Flames of Decay': '绝望之炎',
        'Gnashing of Teeth': '啃咬',
        'Last Gasp': '哀诉',
        'Lost Hope': '恍惚的叫声',
        'Meaningless Destruction': '绝望中的狂乱',
        'Mouth Off': '空口白话',
        'Note of Despair': '绝望的叫声',
        'Poison Heart': '毒液块',
        'Total Wreck': '极尽破坏',
        'Unholy Water': '水牢弹',
        'Vitriol': '言出必行',
        'Wallow': '呜咽',
        'What Is Left': '污秽的左手',
        'What Is Right': '污秽的右手',
      },
    },
    {
      'locale': 'ko',
      'replaceSync': {
        'Devatagara': '데바타 사원',
        'Insight': '이장 저택',
        'Svarbhanu': '스바르바누',
        'Terminus Snatcher': '종말의 강탈자',
        'Terminus Twitcher': '종말의 경련자',
        'Terminus Wrecker': '종말의 파괴자',
        'Trnakiya': '숲속 공터',
      },
      'replaceText': {
        '\\(Bubble\\)': '(구슬)',
        '\\(Knockback\\)': '(넉백)',
        '\\(Spread\\)': '(산개)',
        '--meteor': '--메테오',
        'Aether Siphon': '속성 흡수',
        'Aether Spray': '속성 방출',
        'Aetherial Disruption': '지맥 폭주',
        'Chaotic Pulse': '지맥 활성',
        'Chaotic Undercurrent': '지맥 난류',
        'Cosmic Kiss': '착탄',
        'Crumbling Sky': '유성 소환',
        'Flames of Decay': '절망의 불꽃',
        'Gnashing of Teeth': '물기',
        'Last Gasp': '슬픈 호소',
        'Lost Hope': '망연자실한 외침',
        'Meaningless Destruction': '절망의 광란',
        'Mouth Off': '유구무행',
        'Note of Despair': '절망의 외침',
        'Poison Heart': '독액 덩어리',
        'Total Wreck': '때려부수기',
        'Unholy Water': '물감옥',
        'Vitriol': '유언실행',
        'Wallow': '오열',
        'What Is Left/What Is Right': '부정한 왼손/오른손',
      },
    },
  ],
};

export default triggerSet;
